/*!
\file InputWidget.h
\brief Contains declaration of InputWidget
*/

#ifndef INPUTWIDGET_H
#define INPUTWIDGET_H

#include<QDialog>
#include<QHBoxLayout>
#include<QLabel>
#include<QButtonGroup>
#include<QCheckBox>
#include<QVBoxLayout>
#include<QDialogButtonBox>

#include<Graph.h>
#include<DManager.h>

/*!
\class InputWidget
\brief This class is used by Algorithm when an Algorithm requests Node or Edge input from user.
*/

class InputWidget: public QDialog{
Q_OBJECT
public:
	static Node *getNode( Graph *g, QString comment );
	//!< Request user for Node input.
	static Edge *getEdge( Graph *g, QString comment );
	//!< Request user for Edge input.
private:
	InputWidget( Graph *g, QString comment );
	~InputWidget();
	void showEdges();
	void showNodes();
	Node *resultNode();
	Edge *resultEdge();
	
	QHBoxLayout *m_layout;
	const Graph *m_graph;
	QLabel *m_label;
	QButtonGroup *m_buttonGroup;
	QWidget *m_widget;
	QVBoxLayout *m_childLayout;
	QWidget *m_outer;
	QVBoxLayout *m_outerLayout;
	QDialogButtonBox *m_dialogButtons;
	int m_selectedID;
private slots:
	void selectionChanged(int selected);
};

#endif
